import request from '@/utils/request'
import type {
    GoodsInfoData,
    GoodsInfoResult,
    SimilarResult,
    GoodsIconData,
    SetGoodsLikesResult,
    SetGoodsCollectionResult,
    SetGoodsSharesResult,
    AdverData,
    AdverResult,
    AuthorPriceData,
    SetShopCartData
} from './types'


class APIDetails {

    /** 获取钱包金额 */
    static getWallet() {
        return request<any>('/getWallet', {
            method: 'POST'
        })
    }
    /** 未登录状态下，获取视频详情 */
    static getGoodsInfo(data: GoodsInfoData) {
        return request<GoodsInfoResult>('/getGoodsInfo', {
            method: 'POST',
            body: data
        })
    }

    /** 登录状态下，获取视频详情 */
    static getLoginGoodsInfo(data: GoodsInfoData) {
        return request<GoodsInfoResult>('/getLoginGoodsInfo', {
            method: 'POST',
            body: data
        })
    }

    static getNewGoodsInfo(data: GoodsInfoData) {
        return request<any>('/getNewGoodsInfo', {
            method: 'POST',
            body: data
        })
    }

    static getLoginNewGoodsInfo(data: GoodsInfoData) {
        return request<any>('/getLoginNewGoodsInfo', {
            method: 'POST',
            body: data
        })
    }

    /** 获取相关推荐 */
    static getSimilar(data: GoodsInfoData) {
        return request<SimilarResult[]>('/getSimilar', {
            method: 'POST',
            body: data
        })
    }

    /** 店铺其他作品 */
    static getShopOther(data: GoodsInfoData) {
        return request<SimilarResult[]>('/getShopOther', {
            method: 'POST',
            body: data
        })
    }

    /** 新增点赞量 */
    static setGoodsLikes(data: GoodsIconData) {
        return request<SetGoodsLikesResult>('/setGoodsLikes', {
            method: 'POST',
            body: data
        })
    }

    /** 收藏作品 */
    static setCollection(data: GoodsIconData) {
        return request<SetGoodsCollectionResult>('/setCollection', {
            method: 'POST',
            body: data
        })
    }

    /** 新增分享量 */
    static setGoodsShares(data: GoodsIconData) {
        return request<SetGoodsSharesResult>('/setGoodsShares', {
            method: 'POST',
            body: data
        })
    }

    /** 登录之后新增分享量 */
    static setLoginGoodsShares(data: GoodsIconData) {
        return request<SetGoodsSharesResult>('/setLoginGoodsShares', {
            method: 'POST',
            body: data
        })
    }

    /** 获取平台广告 */
    static getAdver(type: AdverData) {
        return request<AdverResult[]>('/getAdver', {
            method: 'POST',
            body: { type }
        })
    }

    /** 获取平台广告 */
    static getLoginAdver(type: AdverData) {
        return request<AdverResult[]>('/getLoginAdver', {
            method: 'POST',
            body: { type }
        })
    }

    /** 关注店铺 */
    static setUserConcern(Invite_code: string) {
        return request<any>('/setUserConcern', {
            method: 'POST',
            body: { Invite_code }
        })
    }

    /** 取消关注店铺 */
    static cancelUserConcern(Invite_code: string) {
        return request<any>('/cancelUserConcern', {
            method: 'POST',
            body: { Invite_code }
        })
    }

    /** 获取授权价格 */
    static getAuthorPrice(data: AuthorPriceData) {
        return request<any>('/getAuthorPrice', {
            method: 'POST',
            body: data
        })
    }

    /** 加入购物车 */
    static setShopCart(data: SetShopCartData) {
        return request<any>('/setShopCart', {
            method: 'POST',
            body: data
        })
    }

    /** 获取购物车列表 */
    static getShopCart() {
        return request<any>('/getShopCart', {
            method: 'POST'
        })
    }

    /** 删除购物车 */
    static cancelShopCart(id: number) {
        return request<any>('/cancelShopCart', {
            method: 'POST',
            data: { id }
        })
    }

    /** 获取集合 */
    static getSetlist(params: PageQuery, data: any) {
        return request<any>('/getSetlist', {
            method: 'POST',
            params,
            body: data
        })
    }

    /** 获取举报类型 */
    static getReportsType() {
        return request<any>('/getReportsType', {
            method: 'POST'
        })
    }

    /** 上传举报信息 */
    static setReports(data: any) {
        return request<any>('/setReports', {
            method: 'POST',
            body: data
        })
    }

    /** 获取搬运利润比例 */
    static getTransportProfit(data: any) {
        return request<any>('/getTransportProfit', {
            method: 'POST',
            body: data
        })
    }

    /** 加入搬运列表 */
    static setTransport(data: any) {
        return request<any>('/setTransport', {
            method: 'POST',
            body: data
        })
    }

    static getConsumeLog(data: any) {
        return request<any>('/getConsumeLog', {
            method: 'POST',
            body: data
        })
    }

    static getReward() {
        return request<any>('/getReward', {
            method: 'POST'
        })
    }

    static setRewardOrder(data: any) {
        return request<any>('/setRewardOrder', {
            method: 'POST',
            body: data
        })
    }

    static getGoodsForOrder(data: any) {
        return request<any>('/getGoodsForOrder', {
            method: 'POST',
            body: data
        })
    }

    static setOrder(data: any) {
        return request<any>('/setOrder', {
            method: 'POST',
            body: data
        })
    }

    static getCartForOrder(shop_ids: any) {
        return request<any>('/getCartForOrder', {
            method: 'POST',
            body: { shop_ids }
        })
    }

    static setCartOrder(data: any) {
        return request<any>('/setCartOrder', {
            method: 'POST',
            body: data
        })
    }

    static getPeriodsSet(params: any, periods_id: any) {
        return request<any>('/getPeriodsSet', {
            method: 'POST',
            params,
            body: { periods_id }
        })
    }



}

export default APIDetails